package com.eb.dao;

import com.eb.pojo.BargainGoods;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.Map;

public interface KjDao extends JpaRepository<BargainGoods,Long> {


    @Query(value = "SELECT b.*,g.goods_name,g.goods_img,g.goods_price FROM bargain_goods b LEFT JOIN  goods g on b.good_id=g.id",nativeQuery = true,countQuery = "select COUNT(*) from(SELECT b.*,g.goods_name,g.goods_img,g.goods_price FROM bargain_goods b LEFT JOIN  goods g on b.good_id=g.id)abc")
    Page<Map<String, Object>> list(String s, Pageable of);

}
